<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<title>第2种方式实现</title>
<script type="text/javascript">
	function add() {
		document.form1.action = "countAction!add";
		document.form1.submit();
	}
	function minus() {
		document.form1.action = "countAction!minus";
		document.form1.submit();
	}
	function multiply() {
		document.form1.action = "countAction!multiply";
		document.form1.submit();
	}
	function divide() {
		document.form1.action = "countAction!divide";
		document.form1.submit();
	}
</script>

</head>

<body>
	<form action="countAction" name="form1">
		数据1：<input type="text" name="num1" value=${num1} /><s:fielderror fieldName="num1"/><br> 
		数据2：<input type="text" name="num2" value=${num2} /><s:fielderror fieldName="num2"/><br> 
		    <input type="submit" onclick="add()" value="加" /> 
			<input type="button" onclick="minus()" value="减" /> 
			<input type="button" onclick="multiply()" value="乘" /> 
			<input type="button" onclick="divide()" value="除" />
	</form>
	<br>
	<s:include value="result.jsp"></s:include>
</body>
</html>
